<html>
<head><meta charset="utf-8"><title>Perf concerns and weird vector sizes · project-portable-simd · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/index.html">project-portable-simd</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Perf.20concerns.20and.20weird.20vector.20sizes.html">Perf concerns and weird vector sizes</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="237223001"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Perf%20concerns%20and%20weird%20vector%20sizes/near/237223001" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jubilee <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Perf.20concerns.20and.20weird.20vector.20sizes.html#237223001">(May 03 2021 at 20:24)</a>:</h4>
<p>A common issue that people seem to express is "won't code for Vec3 be slow?", which relies on assuming various things about how the vectors are packed and such, and since our API is const generic, we're going to have this discussion a lot if we loosen our lane limits. Something to keep paying attention to, I suppose.</p>



<a name="237225593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Perf%20concerns%20and%20weird%20vector%20sizes/near/237225593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Perf.20concerns.20and.20weird.20vector.20sizes.html#237225593">(May 03 2021 at 20:41)</a>:</h4>
<p>On SimpleV, vec3 is likely faster than vec4 and uses less space.</p>



<a name="237230936"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Perf%20concerns%20and%20weird%20vector%20sizes/near/237230936" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Perf.20concerns.20and.20weird.20vector.20sizes.html#237230936">(May 03 2021 at 21:11)</a>:</h4>
<p><span class="user-mention" data-user-id="229517">@Jacob Lifshay</span> are SimpleV vectors O(n)?</p>



<a name="237234421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Perf%20concerns%20and%20weird%20vector%20sizes/near/237234421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Perf.20concerns.20and.20weird.20vector.20sizes.html#237234421">(May 03 2021 at 21:26)</a>:</h4>
<p>yes...they are processed by sending individual vector element operations to the cpu backend, which then packs them up in groups and executes them. so you can still get the same performance as traditional simd, but with waay more flexibility. if you have a bunch of vec3 the backend can repack those operations into groups of 4, 8, 16, etc. -- whatever width the simd alu(s) have.</p>



<a name="237234710"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Perf%20concerns%20and%20weird%20vector%20sizes/near/237234710" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Caleb Zulawski <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Perf.20concerns.20and.20weird.20vector.20sizes.html#237234710">(May 03 2021 at 21:28)</a>:</h4>
<p>Cool, sounds like a good design</p>



<a name="237234747"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257879-project-portable-simd/topic/Perf%20concerns%20and%20weird%20vector%20sizes/near/237234747" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jacob Lifshay <a href="https://rust-lang.github.io/zulip_archive/stream/257879-project-portable-simd/topic/Perf.20concerns.20and.20weird.20vector.20sizes.html#237234747">(May 03 2021 at 21:28)</a>:</h4>
<p>the vector instructions are unpacked into the individual element operations when the instructions are decoded.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>